/**
 * @author: 團長
 * @date: 2014-4-2-下午2:49:24
 */
package net.loyintean.pearlshell.basedb;

import java.util.List;

import net.loyintean.pearlshell.base.model.IResult;
import net.loyintean.pearlshell.basedb.dto.BaseDto;
import net.loyintean.pearlshell.basedb.exception.TransactionException;

/**
 * special interface for query all data as a list from data base.
 * <p>
 * the input and output parameter should be the same class as T
 * 
 * @author 團長
 * @since 2014-4-2
 * @version 1.0.0
 */
public interface IListQueryDBService<T extends BaseDto> {

	/**
	 * query a list contains all objects from database.
	 * 
	 * @author 團長
	 * @since 2013-5-14
	 * @param dto
	 *            the data in dto is used for where clause.<br>
	 *            status SUCCESS: everything is ok, and the getData() will
	 *            return the dao result.<br>
	 *            status FAIL: the list returned by dao is null or empty.
	 * @return the rows queryid by the sql. If no data in database, it should be
	 *         an empty list, but not null.
	 * @throws TransactionException
	 */
	public IResult<List<T>> queryDtoList(T dto) throws TransactionException;
}
